{% extends 'shop/base.html' %}
{% block title %}
    天天生鲜-首页
{% endblock %}
{% block lable %}
    <!--首页头部搜索栏导航-->
    <header class="container">
        <div class="col-xs-12 col-sm-3">
            <img src="/static/shop/images/logo.png"/>
        </div>
        <div class="col-xs-12 col-sm-6 makepos">
            <form method="post" action="/shop/seek/">
                {% csrf_token %}
            <div class="input-group">
                <input type="text" class="form-control" placeholder="搜索商品" name="goods">
                <span class="input-group-btn">
                    <button class="btn btn-success" type="submit">搜&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;索</button>
                </span>
            </div><!-- /input-group -->
            </form>
        </div>
        <div class="col-xs-12 col-sm-3">
            <a class="btn btn-success pull-right" type="button" href="/shop/cart/">
                <img src="/static/shop/images/cart.png"/>我的购物车 <span class="badge">{{ number }}</span>
            </a>
        </div>
    </header>
{% endblock %}
{% block style %}
    <script src="/static/shop/js/jquery.min.js"></script>
    <link rel="stylesheet" href="/static/shop/css/bootstrap.css"/>
    <script src="/static/shop/js/bootstrap.js"></script>
    <link rel="stylesheet" href="/static/shop/css/index.css">
    <link rel="stylesheet" href="/static/shop/css/footer.css">
{% endblock %}
{% block contenter %}
    <!--首页头部轮播列表栏导航-->
    <menu class="container">
        <div class="col-xs-12 col-sm-2">
            <ul class="list-group">
                <li class="list-group-item active">全部商品分类</li>
                {% for t in type_list %}
                    <li class="list-group-item"><a href="#{{ t.type }}"><img src="/static/{{ t.t_logo }}/"/>{{ t.type }}&nbsp;&nbsp;</a>
                    </li>
                {% endfor %}
            </ul>
        </div>
        <div class="col-xs-12 col-sm-10">
            <ul class="nav nav-tabs">
                <li role="presentation" class="active"><a href="/shop/">首页</a></li>
                <li role="presentation"><a href="#">手机生鲜</a></li>
                <li role="presentation"><a href="#">抽奖</a></li>
            </ul>
            <div class="col-xs-12 col-sm-9">
                <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
                    <!-- Indicators -->
                    <ol class="carousel-indicators">
                        <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                        <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                        <li data-target="#carousel-example-generic" data-slide-to="2"></li>
                        <li data-target="#carousel-example-generic" data-slide-to="3"></li>
                    </ol>
                    <!-- Wrapper for slides -->
                    <div class="carousel-inner" role="listbox">
                        <div class="item active">
                            <img src="/static/shop/images/slide.jpg">
                        </div>
                        <div class="item">
                            <img src="/static/shop/images/slide02.jpg">
                        </div>
                        <div class="item">
                            <img src="/static/shop/images/slide03.jpg">
                        </div>
                        <div class="item">
                            <img src="/static/shop/images/slide04.jpg">
                        </div>
                    </div>

                    <!-- Controls -->
                    <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                        <span class="sr-only">Previous</span>
                    </a>
                    <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                        <span class="sr-only">Next</span>
                    </a>
                </div>
            </div>
            <div class="col-xs-12 col-sm-3">
                <img src="/static/shop/images/adv01.jpg" class="mypic"/>
                <img src="/static/shop/images/adv02.jpg" class="mypic"/>
            </div>
        </div>
    </menu>
    <!--商品分类列表水平栏-->
    {% for t in type_list %}
        <section class="container" id="{{ t.type }}">
            <div class="panel panel-success">
                <div class="panel-heading">{{ t.type }}
                    <div class="pull-right"><a href="/shop/list/{{ t.id }}/">查看更多...</a></div>
                </div>
                <div class="panel-body">
                    <div class="col-xs-12 col-sm-2">
                        <img src="/static/{{ t.t_picture }}/" class="img-responsive">
                    </div>
                    {% load money %}
                    {% for g in t.goods_set.all|rest %}
                        <div class="col-xs-12 col-sm-2">
                            <a href="/shop/detail/{{ g.id }}/" class="thumbnail">
                                <p class="text-center">{{ g.g_name }}</p><br/>
                                <img src="/static/{{ g.g_picture }}/" class="img-responsive">
                                <p class="text-center">¥{{ g.g_price }}元</p>
                            </a>
                        </div>
                    {% endfor %}
                </div>
            </div>
        </section>
    {% endfor %}
{% endblock %}
{% block script %}

{% endblock %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>天天生鲜——首页</title>
    <script src="/static/shop/js/jquery.min.js"></script>
    <link rel="stylesheet" href="/static/shop/css/bootstrap.css"/>
    <script src="/static/shop/js/bootstrap.js"></script>
    <link rel="stylesheet" href="/static/shop/css/index.css">
    <link rel="stylesheet" href="/static/shop/css/footer.css">
</head>
<body>


<div class="footer">
    <div class="foot_link">
        <a href="#">关于我们</a>
        <span>|</span>
        <a href="#">联系我们</a>
        <span>|</span>
        <a href="#">招聘人才</a>
        <span>|</span>
        <a href="#">友情链接</a>
    </div>
    <p>CopyRight © 2016 北京天天生鲜信息技术有限公司 All Rights Reserved</p>
    <p>电话：010-****888 京ICP备*******8号</p>
</div>


</body>
</html>